
// 管理项目用户相关接口
import service from "./service";
// 用户相关请求地址
const API = {
  GET_ORDER_URL: '/order/count',
  ORDER_URL: '/order',
  DELETE_URL: '/cart/delete',
  ADD_ORDER: '/order/submitFromCart',
  ORDER_GET: '/orderItem/'
}

let userId = localStorage.getItem("userId")

export const getOrderCountApi = () => service.get(API.GET_ORDER_URL + `/${userId}`)
export const deleteOrderApi = () => service.post(API.DELETE_URL, [4])
export const getOrderApi = () => service.get(API.ORDER_URL + `/${userId}`)
export const addOrderApi = (data) => service.post(API.ADD_ORDER, data)
export const getOrderItemApi = (id) => service.get(API.ORDER_GET + `${id}`)
// export const getCart = () => service.get(API.LOGIN_URL)